#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
bool exist(vector<int>& a, int target) {
    if(a.size() == 0) {
        return false;
    }
    int L = 0;
    int R = a.size() - 1;
    while(L < R) {
        int mid = L + ((R - L)>>1);
        if(a[mid] > target) {
            R = mid -1;
        } else if(a[mid] < target) {
            L = mid + 1;
        }else {
            return true;
        }
    }
    return false;
}
int main() {
    vector<int> a = {1, 5, 40, 60, 8, 8, 9, 4, 10};
    sort(a.begin(), a.end());
    if(exist(a, 10)) {
        cout << "exist" << endl;
    }else {
        cout << "not exist" << endl;
    }
    return 0;
}